package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        try {
            System.out.println("程序开始");
            String str = "abc";
            System.out.println(Integer.parseInt(str));
            System.out.println("程序结束");
        }catch (NullPointerException e){
            System.out.println("空指针异常");
        }catch (NumberFormatException e){
            System.out.println("数字格式化异常");
        }
    }
}
